package com.atguigu.daijia.driver.service.impl;

import com.atguigu.daijia.common.result.Result;
import com.atguigu.daijia.driver.client.OcrFeignClient;
import com.atguigu.daijia.driver.service.OcrService;
import com.atguigu.daijia.model.vo.driver.DriverLicenseOcrVo;
import com.atguigu.daijia.model.vo.driver.IdCardOcrVo;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;


@Slf4j
@Service("ocrService")
@SuppressWarnings({"unchecked", "rawtypes"})
public class OcrServiceImpl implements OcrService {
    @Resource
    private OcrFeignClient ocrFeignClient;

    /*
     * @param file 
     * @==============History===============<br/>;
     * @Description //   身份证识别
     * @Date 2024/8/7
     * @Author < a href="15991488967@163.com">chen</ a>;
     */
    @Override
    public IdCardOcrVo idCardOcr(MultipartFile file) {
        Result<IdCardOcrVo> ocrVoResult = ocrFeignClient.idCardOcr(file);
        return ocrVoResult.getData();
    }

    /*
     * @param file
     * @==============History===============<br/>;
     * @Description //   驾驶证识别
     * @Date 2024/8/7
     * @Author < a href="15991488967@163.com">chen</ a>;
     */
    @Override
    public DriverLicenseOcrVo driverLicenseOcr(MultipartFile file) {
        Result<DriverLicenseOcrVo> driverLicenseOcrVoResult = ocrFeignClient.driverLicenseOcr(file);
        return driverLicenseOcrVoResult.getData();
    }
}
